<template>
	<view class="page">
		<view class="bodys" v-for="(item,index) in dataList" :key="item.index" v-if="item.data.length>0">
			<view class="title">
				<view class="">
					{{index}}<text style="font-size: 15px;">月</text>
				</view>
				<view class="title_se">
					共转出 ￥{{item.all_money}}
				</view>
			</view>
			<view class="cont" v-for="(item,index) in item.data" :key="index">
				<view class="justify-content-start">
					<view class="cont_left justify-content-sp">
						<view class="cont_left_left">
							<view class="fir">
								<text class="right">转给-{{item.toname}}</text>({{item.tomobile}})
							</view>
							<view class="se">
								转账类型-转到{{item.platform}}
							</view>
							<view class="thr">
								{{item.create_time}}
							</view>
						</view>
						<view class="cont_left_right">
							-{{item.money}}
						</view>
					</view>
					<view class="cont_right" @click="del(item.id)">
						删除
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getTransferList,
		delTransferList
	} from '../../api/walletDetails/index.js'
	export default {
		data() {
			return {
				dataList: [],
			}
		},
		onLoad() {
			this.init();
		},
		methods: {
			init() {
				getTransferList().then(res => {
					this.dataList = res.data;
				})
			},
			del(e) {
				var data = {
					id: e
				};
				delTransferList(data).then(res => {
					uni.showToast({
						"icon": 'none',
						"title": res.msg
					});
					this.init()
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.page {
		.bodys {
			margin: 30rpx;
			padding: 30rpx 0;
			background-color: white;
			border-radius: 30rpx;

			.title {
				padding: 0 30rpx;
				font-size: 25px;
				font-weight: 600;
				padding-bottom: 10rpx;
				border-bottom: 1px solid #b2b2b2;

				.title_se {
					font-size: 15px;
					color: #b2b2b2;
					font-weight: 500;
				}
			}

			.cont {
				border-bottom: 1px solid #b2b2b2;

				.cont_left {
					padding: 20rpx 30rpx;
					width: 75%;

					.cont_left_left {
						color: #b2b2b2;
						font-size: 15px;

						.fir {
							padding: 6rpx 0;

							.right {
								font-weight: 600;
								color: black;
								padding-right: 6rpx;
							}
						}

						.se {
							padding: 6rpx 0;
						}

						.thr {
							padding: 6rpx 0;
						}
					}

					.cont_left_right {
						display: flex;
						text-align: center;
						align-items: center;
						font-weight: 550;
					}
				}

				.cont_right {
					flex: 1;
					background-color: #ff0808;
					color: white;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}
</style>